<?php
    // 连接数据库
    if(!($db=new SQLite3('czz.db', '0666')))
    {
        echo "<h2>数据库连接错误！</h2>";
        die();
    }
?>
<!DOCTYPE html>
<html lang="zh" class="no-js">
  <head>
    <meta charset="utf-8">
    <title>快速查询 - 业余无线电台操作证书考试在线学习系统 - 黑龙江火腿网</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <!--[if lte IE 8]><link rel="stylesheet" href="responsive-nav.css"><![endif]-->
    <!--[if gt IE 8]><!--><link rel="stylesheet" href="styles.css"><!--<![endif]-->
    <script>
      var doc = document, docEl = doc.documentElement;
      docEl.className = docEl.className.replace(/(^|\s)no-js(\s|$)/, " js ");
    </script>
    <script src="responsive-nav.js"></script>
  </head>
  <body>

    <div role="navigation" id="nav">
      <ul>
        <li><a href="index.html">网站首页</a></li>
        <li><a href="class_a.html">A类考试</a></li>
        <li><a href="class_b.html">B类考试</a></li>
        <li><a href="class_c.html">C类考试</a></li>
        <li class="active"><a href="search.html">快速查询</a></li>
      </ul>
    </div>

    <div role="main" class="main">
      <a href="#nav" id="toggle">导航</a>
      <h1>业余无线电台操作证书考试在线学习系统</h1>


        <?php
          // 显示内容
          $czz_search = "'%".$_REQUEST['czz_search']."%'";
          $result=$db->query("SELECT * FROM czz WHERE czz_q like $czz_search;");
          while($row=$result->fetchArray(SQLITE3_ASSOC))
          {
              echo "<p><b>问:".$row['czz_q']."</b><br /><br />";
              echo "答:".$row['czz_a']."<br />";
              $pic = $row['czz_i'];
              if(file_exists("pic/$pic.jpg"))
              {
                echo "图:<img src=\"pic/".$row['czz_i'].".jpg\" /></p>";
              }
          }
        ?>
      <p>
      <a href="search.html">重新查询</a>
    </div>
 

    <script>
      var navigation = responsiveNav("#nav", {customToggle: "#toggle"});
    </script>
    
  </body>
</html>
<?php
    // 关闭数据库
    $db->close();
?>
